<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <!-- <script src="http://localhost:8080"></script> -->
    <!-- 引入react核心库 -->
    <script type="text/javascript" src="../../js/react.development.js"></script>
    <!-- 用于支持react操作DOM -->
    <script type="text/javascript" src="../../js/react-dom.development.js"></script>
    <!-- 用于将jsx转为js -->
    <script type="text/javascript" src="../../js/babel.min.js"></script>
</head>
<body>
    <div id="title"></div>

    <script type="text/babel">
        // 创建类式组件
        class MyComponent extends React.Component{
            // 必须写
            render() {
                console.log("render中的this:",this);
                //  要有返回值
                return (
                    <h2>类定义组件</h2>
                )
            }
        }
        ReactDOM.render(<MyComponent/>,document.getElementById("title"))
    </script>
</body>
<style>
</style>
</html>